package com.ck.springboot;

import com.ck.springboot.lock.CacheKeyGenerator;
import com.ck.springboot.lock.LockKeyGenerator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
//import tk.mybatis.spring.annotation.MapperScan;

/**
 *
 */
@SpringBootApplication
//@MapperScan(basePackages = "ck.springboot.mapper")
public class RedisLockApplication  implements CommandLineRunner {
    private Logger logger = LoggerFactory.getLogger(RedisLockApplication.class);

    public static void main(String[] args) {
        SpringApplication.run(RedisLockApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        logger.info("服务启动完成!");
    }

    @Bean
    public CacheKeyGenerator cacheKeyGenerator() {
        return new LockKeyGenerator();
    }

}
